void main() async {
  task1();
  String end = await task2();
  task3(end);
}

void task1() {
  print('task1 is complete');
}

Future task2() async {
  Duration threeSeconds = Duration(seconds: 3);

  String result = await Future.delayed(threeSeconds, () {
    print('task2 is runned');
    return 'Task2 is complete';
  });
  return result;
}

void task3(String param) {
  print('task3 is $param');
}